<?php
namespace app\index\controller;

use think\Request;
use think\Controller;
use think\Session;
use think\Db;


class Basic extends Controller
{
//    protected $auth;
    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        // 判断登陆状态
        if(!session('admin')) {
            $this->redirect('Login/index');
        }
        $user = Session::get('admin')['username'];
        $auth = Db::name('admin')->where('username','=',$user)->find();
//        print_r($auth);
        Session::set('auth',$auth);
        $this->assign('auth',$auth);
    }
}